import java.util.Scanner;

public class Demo10 {
    public static void main(String[] args) {
//        A:案例演示:    数组查表法(根据键盘录入索引,查找对应星期)
        String[] arr = {"星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期天"};
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入1---7之间");
        int num = scanner.nextInt();
        String a = ChaXun(num,arr);
        System.out.println(a);
    }

    private static String ChaXun(int num, String[] arr) {
        if (num>=1&&num<=7){
            return arr[num-1];
        }else {
            return "输入非法";
        }
    }
}
